<template>
    <van-nav-bar title="设置" left-text="返回" left-arrow @click-left="onClickLeft" />
    <br>
    <van-cell-group inset>
        <van-cell v-for="item in data" :key="item.title" :title="item.title" :url="item.path" is-link center
            size="large" />
    </van-cell-group>
    <div class="bottom">
        <van-button type="danger" block @click="exitLogin">退出登录</van-button>
    </div>
</template>

<script setup>
import { ref } from 'vue'
let data = ref([
    { title: '账号与个人信息管理', path: '/account' },
    { title: '支付设置', path: '/pay' },
    { title: '个性化管理', path: '/personal' },
    { title: '服务授权管理', path: '/authorization' },
    { title: '通用', path: '/common' },
    { title: '语言/Language', path: '/language' },
    { title: '用户指南', path: '/guide' },
    { title: '服务协议与平台规则', path: '/agreement' },
])
const onClickLeft = () => history.back();

const exitLogin = () => {
    localStorage.removeItem('userid')
    localStorage.removeItem('token')
    localStorage.removeItem('retoken')
    window.location.href = '/login'
}
</script>

<style scoped>
.bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
}

.bottom button {
    border: 0;
    background-color: white;
    color: orange;
}
</style>